<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
.cubes {
    position: relative;
    font-size: 0;
}
.cubes > div {
    width: 10px;
    height: 10px;
    background-color: #1ab394;
    position: absolute;
    transform: rotateZ(180deg);
    animation: cubes 1.8s infinite ease-in-out;
}
.cubes > div:nth-child(2) {
    animation-delay: -0.9s;
}
@keyframes cubes {
    25% {
        transform: translateX(30px) rotate(-90deg) scale(0.5);
    }
    50% {
        transform: translateX(30px) translateY(30px) rotate(-180deg);
    }
    75% {
        transform: translateX(0px) translateY(30px) rotate(-270deg) scale(0.5);
    }
    100% {
        transform: rotate(-360deg);
    }
}
</style>
</head>
<body>
<div class="cubes">
    <div></div>
    <div></div>
</div>
</body>
</html>